<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE >
<html>
<head>
<base href="<%=basePath%>">
<title>测试validate验证</title>
<script type="text/javascript" src="js/jquery.min.js"></script>
<style type="text/css">

	tr td {
			padding-top: 10px;	
	}

</style>

<script type="text/javascript">

	$(function(){
	
		$("span").each(function(i,ele){
			if($(ele).text()!="" && $(ele).text()!=null){
				$("#mytable").css("width","400px");
				return false;
			}
			
		});
	
	
	});

</script>


</head>

<body>

<div style="border: 1px solid;display: inline-block;">
	<form action="<%=basePath %>validateFrame!add.action" method="post">
		<table style="width: 280px" id="mytable">
			<tr>
				<td>新闻编号:</td>
				<td><input type="text" id="news.nid" name="news.nid"></td>
				<td><span>${fieldErrors['news.nid'][0] }</span></td>
			</tr>
			<tr>
				<td>新闻名称:</td>
				<td><input type="text" id="news.title" name="news.title"></td>
				<td><span>${fieldErrors['news.title'][0] }</span></td>
			</tr>
			<tr>
				<td>新闻价值:</td>
				<td><input type="text" id="news.price" name="news.price"></td>
				<td><span>${fieldErrors['news.price'][0] }</span></td>
			</tr>
			<tr>
				<td>发布日期:</td>
				<td><input type="date" id="news.pubdate" name="news.pubdate"></td>
				<td><span>${fieldErrors['news.pubdate'][0] }</span></td>
			</tr>
			<tr>
				<td>电子邮箱:</td>
				<td><input type="text" id="news.email" name="news.email"></td>
				<td><span>${fieldErrors['news.email'][0] }</span></td>
			</tr>
			<tr>
				<td colspan="2"><input type="submit" value="提交"></td>
			</tr>
		</table>
	</form>
</div>



</body>
</html>
